#ifndef CFIELD_H_INCLUDED
#define CFIELD_H_INCLUDED

#include "CBall.h"
#include <vector>

struct xoy {
    int x; int y;
};

//====================================================================================================
class CField {
    public:
        static CField Field;

    public:
        CBall   Map[100][100];

        int     Score;
        int     TMP_Score;
        int     Buf_Score;
        bool    Live;

        bool    Animate;
        int     OldTime;

        bool    MotionX;
        bool    MotionY;
        int     V[100];

        int     Width;
        int     Height;

        xoy     Focus;

        std::vector<xoy> SelectedBalls;

    private:
        bool GameOver;

    public:
		CField();

		virtual ~CField();

    public:
        virtual bool OnInit(int Wx, int Hx);

        virtual void OnRender(SDL_Surface* Surf_Display, SDL_Surface* image);

        virtual bool OkField(int x, int y);

        virtual void Check();

        virtual void FocusBall(int x, int y);

        virtual bool SelectBall(int x, int y);

        virtual void ClearFocus();

        virtual void ClearSelect();

        virtual void KillBalls();

        virtual void DFS(int x, int y, int color);

        virtual void OnLoop();

        virtual void OnAnimate();

};
//====================================================================================================

#endif // CFIELD_H_INCLUDED
